<?php

namespace App\Service\Message\v1_0_4;

use App\Model\UserProfile;
use App\Model\UserRecOnline;
use App\Service\BaseService;

/**
 * 消息中心 - 用户上线新消息信息
 */
class OnlineRecShowService extends BaseService
{
    public function handle()
    {
        $userId = $this->getUserId();
        $profile = UserProfile::getProfile($userId);

        //男用户，不给推荐
        if ($profile->gender == 1) return ['show' => 0, 'new' => 0];

        return [
            'new_num' => UserRecOnline::getNew($userId),
            'show' => check_dev_env() ? 1 : 0,
        ];
    }
}
